﻿package  {
import com.urbansquall.display.Scale9;
import com.urbansquall.display.Scale9Data;
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.geom.Rectangle;
public class Main extends Sprite
{
	[Embed(source='button_normal.swf', symbol='button_normal')]
	private static const ButtonNormalSWF : Class;
	
	public function Main()
	{
		var buttonNormal : DisplayObject = new ButtonNormalSWF();
		var scale9Rect : Rectangle = new Rectangle( 10, 10, 34, 34 );
		var buttonNormalScale9Data : Scale9Data = new Scale9Data( buttonNormal, scale9Rect );
				
		for( var i : int = 0; i < 30; i++ )
		{
			var scale9 : Scale9 = new Scale9( buttonNormalScale9Data );
			scale9.x = Math.floor( Math.random() * ( this.stage.stageWidth ) );
			scale9.y = Math.floor( Math.random() * ( this.stage.stageHeight ) );
			scale9.width = Math.floor( 40 + Math.random() * ( this.stage.stageWidth - scale9.x ) );
			scale9.height = Math.floor( 40 + Math.random() * ( this.stage.stageHeight - scale9.y ) );
			addChild( scale9 );
		}
	}
	
} // c
} // p